<?php
/**
 * Descript:
 * User: blue
 * Date: 2018/9/154:35
 */

namespace app\api\validate;


use app\library\base\BaseValidate;

class RuleValid extends BaseValidate
{
    protected $rule=[
        'title'=>'require',
        'name'=>'require|unique:auth_rule',
        'pid'=>'positive',
        'id'=>'require|checkids'
    ];
    protected $message=[
        'title.require'=>'必须输入规则名称',
        'name.require'=>'必须输入规则',
        'pid.positive'=>'父规则必须是正整数',
        'id.require'=>'id不能为空',
        'id.checkIds'=>'id必须为正整数'
    ];
    protected $scene=[
        'post'=>['pid','name','title'],
        'delete'=>['id'],
        'put'=>['id','pid','name','title'],
        'get'=>[]
    ];

}